Optimal. Leaf size=47 \[ -\frac {\tan ^{-1}\left (\frac {x}{\sqrt {1+a}}\right )}{2 \sqrt {1+a}}-\frac {\tanh ^{-1}\left (\frac {x}{\sqrt {1-a}}\right )}{2 \sqrt {1-a}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {1107, 213, 209}
\begin {gather*} -\frac {\text {ArcTan}\left (\frac {x}{\sqrt {a+1}}\right )}{2 \sqrt {a+1}}-\frac {\tanh ^{-1}\left (\frac {x}{\sqrt {1-a}}\right )}{2 \sqrt {1-a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 213
Rule 1107
Rubi steps
\begin {align*} \int \frac {1}{-1+a^2+2 a x^2+x^4} \, dx &=\frac {1}{2} \int \frac {1}{-1+a+x^2} \, dx-\frac {1}{2} \int \frac {1}{1+a+x^2} \, dx\\ &=-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {1+a}}\right )}{2 \sqrt {1+a}}-\frac {\tanh ^{-1}\left (\frac {x}{\sqrt {1-a}}\right )}{2 \sqrt {1-a}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 43, normalized size = 0.91 \begin {gather*} \frac {\tan ^{-1}\left (\frac {x}{\sqrt {-1+a}}\right )}{2 \sqrt {-1+a}}-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {1+a}}\right )}{2 \sqrt {1+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.03, size = 32, normalized size = 0.68
method | result | size |
default | \(\frac {\arctan \left (\frac {x}{\sqrt {a -1}}\right )}{2 \sqrt {a -1}}-\frac {\arctan \left (\frac {x}{\sqrt {1+a}}\right )}{2 \sqrt {1+a}}\) | \(32\) |
risch | \(-\frac {\ln \left (x \sqrt {1-a}-a +1\right )}{4 \sqrt {1-a}}+\frac {\ln \left (x \sqrt {1-a}+a -1\right )}{4 \sqrt {1-a}}-\frac {\ln \left (-x \sqrt {-1-a}-a -1\right )}{4 \sqrt {-1-a}}+\frac {\ln \left (-x \sqrt {-1-a}+a +1\right )}{4 \sqrt {-1-a}}\) | \(96\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 269, normalized size = 5.72 \begin {gather*} \left [-\frac {{\left (a - 1\right )} \sqrt {-a - 1} \log \left (\frac {x^{2} + 2 \, \sqrt {-a - 1} x - a - 1}{x^{2} + a + 1}\right ) + {\left (a + 1\right )} \sqrt {-a + 1} \log \left (\frac {x^{2} - 2 \, \sqrt {-a + 1} x - a + 1}{x^{2} + a - 1}\right )}{4 \, {\left (a^{2} - 1\right )}}, \frac {2 \, {\left (a + 1\right )} \sqrt {a - 1} \arctan \left (\frac {x}{\sqrt {a - 1}}\right ) - {\left (a - 1\right )} \sqrt {-a - 1} \log \left (\frac {x^{2} + 2 \, \sqrt {-a - 1} x - a - 1}{x^{2} + a + 1}\right )}{4 \, {\left (a^{2} - 1\right )}}, -\frac {2 \, \sqrt {a + 1} {\left (a - 1\right )} \arctan \left (\frac {x}{\sqrt {a + 1}}\right ) + {\left (a + 1\right )} \sqrt {-a + 1} \log \left (\frac {x^{2} - 2 \, \sqrt {-a + 1} x - a + 1}{x^{2} + a - 1}\right )}{4 \, {\left (a^{2} - 1\right )}}, -\frac {\sqrt {a + 1} {\left (a - 1\right )} \arctan \left (\frac {x}{\sqrt {a + 1}}\right ) - {\left (a + 1\right )} \sqrt {a - 1} \arctan \left (\frac {x}{\sqrt {a - 1}}\right )}{2 \, {\left (a^{2} - 1\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 257 vs.
\(2 (37) = 74\).
time = 0.33, size = 257, normalized size = 5.47 \begin {gather*} \frac {\sqrt {- \frac {1}{a - 1}} \log {\left (- a^{3} \left (- \frac {1}{a - 1}\right )^{\frac {3}{2}} - a^{2} \sqrt {- \frac {1}{a - 1}} + a \left (- \frac {1}{a - 1}\right )^{\frac {3}{2}} + x - \sqrt {- \frac {1}{a - 1}} \right )}}{4} - \frac {\sqrt {- \frac {1}{a - 1}} \log {\left (a^{3} \left (- \frac {1}{a - 1}\right )^{\frac {3}{2}} + a^{2} \sqrt {- \frac {1}{a - 1}} - a \left (- \frac {1}{a - 1}\right )^{\frac {3}{2}} + x + \sqrt {- \frac {1}{a - 1}} \right )}}{4} + \frac {\sqrt {- \frac {1}{a + 1}} \log {\left (- a^{3} \left (- \frac {1}{a + 1}\right )^{\frac {3}{2}} - a^{2} \sqrt {- \frac {1}{a + 1}} + a \left (- \frac {1}{a + 1}\right )^{\frac {3}{2}} + x - \sqrt {- \frac {1}{a + 1}} \right )}}{4} - \frac {\sqrt {- \frac {1}{a + 1}} \log {\left (a^{3} \left (- \frac {1}{a + 1}\right )^{\frac {3}{2}} + a^{2} \sqrt {- \frac {1}{a + 1}} - a \left (- \frac {1}{a + 1}\right )^{\frac {3}{2}} + x + \sqrt {- \frac {1}{a + 1}} \right )}}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 6.00, size = 31, normalized size = 0.66 \begin {gather*} -\frac {\arctan \left (\frac {x}{\sqrt {a + 1}}\right )}{2 \, \sqrt {a + 1}} + \frac {\arctan \left (\frac {x}{\sqrt {a - 1}}\right )}{2 \, \sqrt {a - 1}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.10, size = 85, normalized size = 1.81 \begin {gather*} \frac {\mathrm {atanh}\left (\frac {2\,x\,\left (\frac {a}{2}-\frac {1}{2}\right )}{\sqrt {1-a}}+\frac {2\,a\,x\,\left (\frac {a}{2}-\frac {1}{2}\right )}{{\left (1-a\right )}^{3/2}}\right )}{2\,\sqrt {1-a}}+\frac {\mathrm {atanh}\left (\frac {2\,x\,\left (\frac {a}{2}+\frac {1}{2}\right )}{\sqrt {-a-1}}+\frac {2\,a\,x\,\left (\frac {a}{2}+\frac {1}{2}\right )}{{\left (-a-1\right )}^{3/2}}\right )}{2\,\sqrt {-a-1}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________